package com.talent.service.iot.mqtt.model.payload;

import java.util.Objects;

/**
 * @ClassName：TlMqttPublishPayload
 * @Author: hszhou
 * @Date: 2024/11/26 13:29
 * @Description: 发布消息载体
 */
public class TlMqttPublishPayload {

    private Object content;

    public Object getContent() {
        return content;
    }

    public void setContent(Object content) {
        this.content = content;
    }

    public TlMqttPublishPayload(Object content) {
        this.content = content;
    }

    public static TlMqttPublishPayload of(String content){
        return new TlMqttPublishPayload(content);
    }

    @Override
    public String toString() {
        return "TlMqttPublishPayload{" +
                "content=" + content +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TlMqttPublishPayload that = (TlMqttPublishPayload) o;
        return Objects.equals(content, that.content);
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(content);
    }
}
